package com.authManager.commons.feignApi;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.authManager.commons.feignApi.hystric.SysCodeApiHystric;
import com.authManager.entity.SysCode;
import com.commons.base.model.AdminPage;
import com.commons.base.model.ResultData;

@FeignClient(value = "authManager-server", fallback = SysCodeApiHystric.class)
public interface SysCodeApi {
	static final String projectAaaApiBaseUrl = "/authManager-server/admin/sysCode";

	/**
	 * 添加【系统编码表】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/saveSysCode", method = { RequestMethod.POST })
	public ResultData<Object> saveSysCode(@RequestParam(value = "codeType",required = false) String codeType,
			@RequestParam(value = "code",required = false) String code, @RequestParam(value = "name",required = false) String name,
			@RequestParam(value = "val",required = false) String val);

	/**
	 * 修改【系统编码表】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/editSysCode", method = { RequestMethod.POST })
	public ResultData<Object> editSysCode(@RequestParam(value = "sysCodeId",required = true) Integer sysCodeId,
			@RequestParam(value = "codeType",required = false) String codeType, @RequestParam(value = "code",required = false) String code,
			@RequestParam(value = "name",required = false) String name, @RequestParam(value = "val",required = false) String val);

	/**
	 * 删除【系统编码表】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/delSysCode", method = { RequestMethod.POST })
	public ResultData<Object> delSysCode(@RequestParam(value = "sysCodeId",required = true) Long sysCodeId);

	/**
	 * 获取【系统编码表】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/getSysCode", method = { RequestMethod.POST })
	public ResultData<SysCode> getSysCode(@RequestParam(value = "sysCodeId",required = true) Long sysCodeId);

	/**
	 * 列表【系统编码表】
	 */
	@RequestMapping(value = projectAaaApiBaseUrl + "/listSysCode", method = { RequestMethod.POST })
	public ResultData<AdminPage<SysCode>> listSysCode(
			@RequestParam(value = "pageNum",defaultValue = "1", required = false) Integer pageNum,
			@RequestParam(value = "pageSize",defaultValue = "10", required = false) Integer pageSize,
			@RequestParam(value = "sysCodeId",required = false) Integer sysCodeId, @RequestParam(value = "codeType",required = false) String codeType,
			@RequestParam(value = "code",required = false) String code, @RequestParam(value = "name",required = false) String name,
			@RequestParam(value = "val",required = false) String val);
}
